<?php
class CategoriesSlider extends CWidget
{
	public $postParams=array();
	public $config=array();
	public $page;
	
	public function run()
  	{?>
  		<div>
  		<?php if (!empty($this->page) && $this->page=="brands"){?>
  			<div class="title_offer ">
			    <h2 class="mod_title helv_black" style="color:#333;">Brand<span class="helv_neue_thin"> Categories</span></h2>  
			 </div>
			 <?php }else{?>
	<div class="title_offer recom_wrap"><span class="helv_neue_thin">Categories</span></div>
	<?php }?>
	<div class="mt7">
		
     <script src="<?php echo ApplicationConfig::app()->params['theme']['jsUrl']?>jsCarousel-2.0.0.js" type="text/javascript"></script>

    <link href="<?php echo ApplicationConfig::app()->params['theme']['cssUrl']?>jsCarousel-2.0.0.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
   
        $(document).ready(function() {

            $('#carouselv').jsCarousel({ onthumbnailclick: function(src) { alert(src); }, autoscroll: true, masked: true, itemstodisplay: 3, orientation: 'v' });
            $('#carouselh').jsCarousel({ onthumbnailclick: function(src) { alert(src); }, autoscroll: false, circular: true, masked: false, itemstodisplay: 5, orientation: 'h' });
            $('#carouselhAuto').jsCarousel({ onthumbnailclick: function(src) { alert(src); }, autoscroll: true, masked: true, itemstodisplay: 5, orientation: 'h' });

        });       
        
    </script>

    <div id="contents">
        <div id="v2">
            <div id="demo-wrapper">
               
                <div id="demo-right">
                    <div id="hWrapper">
                        <div id="carouselh">
                            
                            	<?php 
                            	
                            	$categoryImages = BannerDetails::getList("CATEGORY-HOMEPAGE-IMAGES", array());
				            	if (!empty($categoryImages)){
				            		foreach ($categoryImages as $categoryImage){
				            	?>
				            	<div>
				             	<img src="<?php echo ApplicationConfig::getImageUrl("BANNER-IMAGES", array('file_name'=>$categoryImage->filename));?>" height="78px" width="96px"/>
				               <br />
                                <span class="thumbnail-text"><?php echo $categoryImage->content;?></span>
				               </div>
				                <?php } }
				                else {?>
				                <img src="<?php echo ApplicationConfig::app()->params['theme']['imageUrl']?>no_preview.jpg" height="78px" width="96px"/>
				                <?php }				                
				                ?>
                                
                           
                        </div>  
                    </div>
                </div>
            </div>
        </div>
    </div>


	</div>
</div>
  		
  	<?php }
}
?>  
 